/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * THIS FILE IS AUTOGENERATED BY arktscgen v2.1.9-arktscgen-6. DO NOT EDIT MANUALLY!
 * es2panda fe7c2bfd7c50a1bef62bcedaac78ba82000e6c39(2025-07-10) sdk v1.5.0-dev.36516
 */

import {
    global,
    passNode,
    passNodeArray,
    unpackNonNullableNode,
    unpackNode,
    unpackNodeArray,
    assertValidPeer,
    AstNode,
    KNativePointer,
    nodeByType,
    ArktsObject,
    unpackString
} from "../../reexport-for-generated"

import { BlockStatement } from "./BlockStatement"
import { ClassDefinition } from "./ClassDefinition"
import { Es2pandaModuleKind } from "./../Es2pandaEnums"
import { Es2pandaProgramFlags } from "./../Es2pandaEnums"
import { Es2pandaScriptKind } from "./../Es2pandaEnums"
import { SourcePosition } from "./SourcePosition"

export class Program extends ArktsObject {
    constructor(pointer: KNativePointer) {
        super(pointer)
    }
    /** @deprecated */
    setKind(kind: Es2pandaScriptKind): this {
        global.generatedEs2panda._ProgramSetKind(global.context, this.peer, kind)
        return this
    }
    /** @deprecated */
    pushVarBinder(): this {
        global.generatedEs2panda._ProgramPushVarBinder(global.context, this.peer)
        return this
    }
    /** @deprecated */
    pushChecker(): this {
        global.generatedEs2panda._ProgramPushChecker(global.context, this.peer)
        return this
    }
    get kind(): Es2pandaScriptKind {
        return global.generatedEs2panda._ProgramKindConst(global.context, this.peer)
    }
    get sourceCode(): string {
        return unpackString(global.generatedEs2panda._ProgramSourceCodeConst(global.context, this.peer))
    }
    get sourceFilePath(): string {
        return unpackString(global.generatedEs2panda._ProgramSourceFilePathConst(global.context, this.peer))
    }
    get sourceFileFolder(): string {
        return unpackString(global.generatedEs2panda._ProgramSourceFileFolderConst(global.context, this.peer))
    }
    get fileName(): string {
        return unpackString(global.generatedEs2panda._ProgramFileNameConst(global.context, this.peer))
    }
    get fileNameWithExtension(): string {
        return unpackString(global.generatedEs2panda._ProgramFileNameWithExtensionConst(global.context, this.peer))
    }
    get absoluteName(): string {
        return unpackString(global.generatedEs2panda._ProgramAbsoluteNameConst(global.context, this.peer))
    }
    get resolvedFilePath(): string {
        return unpackString(global.generatedEs2panda._ProgramResolvedFilePathConst(global.context, this.peer))
    }
    get relativeFilePath(): string {
        return unpackString(global.generatedEs2panda._ProgramRelativeFilePathConst(global.context, this.peer))
    }
    /** @deprecated */
    setRelativeFilePath(relPath: string): this {
        global.generatedEs2panda._ProgramSetRelativeFilePath(global.context, this.peer, relPath)
        return this
    }
    get ast(): BlockStatement {
        return unpackNonNullableNode(global.generatedEs2panda._ProgramAst(global.context, this.peer))
    }
    /** @deprecated */
    setAst(ast?: BlockStatement): this {
        global.generatedEs2panda._ProgramSetAst(global.context, this.peer, passNode(ast))
        return this
    }
    get globalClass(): ClassDefinition | undefined {
        return unpackNode(global.generatedEs2panda._ProgramGlobalClass(global.context, this.peer))
    }
    /** @deprecated */
    setGlobalClass(globalClass?: ClassDefinition): this {
        global.generatedEs2panda._ProgramSetGlobalClass(global.context, this.peer, passNode(globalClass))
        return this
    }
    get packageStart(): SourcePosition | undefined {
        return new SourcePosition(global.generatedEs2panda._ProgramPackageStartConst(global.context, this.peer))
    }
    /** @deprecated */
    setPackageStart(start?: SourcePosition): this {
        global.generatedEs2panda._ProgramSetPackageStart(global.context, this.peer, passNode(start))
        return this
    }
    /** @deprecated */
    setSource(sourceCode: string, sourceFilePath: string, sourceFileFolder: string): this {
        global.generatedEs2panda._ProgramSetSource(global.context, this.peer, sourceCode, sourceFilePath, sourceFileFolder)
        return this
    }
    /** @deprecated */
    setPackageInfo(name: string, kind: Es2pandaModuleKind): this {
        global.generatedEs2panda._ProgramSetPackageInfo(global.context, this.peer, name, kind)
        return this
    }
    get moduleName(): string {
        return unpackString(global.generatedEs2panda._ProgramModuleNameConst(global.context, this.peer))
    }
    get modulePrefix(): string {
        return unpackString(global.generatedEs2panda._ProgramModulePrefixConst(global.context, this.peer))
    }
    get isSeparateModule(): boolean {
        return global.generatedEs2panda._ProgramIsSeparateModuleConst(global.context, this.peer)
    }
    get isDeclarationModule(): boolean {
        return global.generatedEs2panda._ProgramIsDeclarationModuleConst(global.context, this.peer)
    }
    get isPackage(): boolean {
        return global.generatedEs2panda._ProgramIsPackageConst(global.context, this.peer)
    }
    get isDeclForDynamicStaticInterop(): boolean {
        return global.generatedEs2panda._ProgramIsDeclForDynamicStaticInteropConst(global.context, this.peer)
    }
    /** @deprecated */
    setFlag(flag: Es2pandaProgramFlags): this {
        global.generatedEs2panda._ProgramSetFlag(global.context, this.peer, flag)
        return this
    }
    /** @deprecated */
    setASTChecked(): this {
        global.generatedEs2panda._ProgramSetASTChecked(global.context, this.peer)
        return this
    }
    get isASTChecked(): boolean {
        return global.generatedEs2panda._ProgramIsASTChecked(global.context, this.peer)
    }
    /** @deprecated */
    markASTAsLowered(): this {
        global.generatedEs2panda._ProgramMarkASTAsLowered(global.context, this.peer)
        return this
    }
    get isASTLowered(): boolean {
        return global.generatedEs2panda._ProgramIsASTLoweredConst(global.context, this.peer)
    }
    get isStdLib(): boolean {
        return global.generatedEs2panda._ProgramIsStdLibConst(global.context, this.peer)
    }
    get isGenAbcForExternal(): boolean {
        return global.generatedEs2panda._ProgramIsGenAbcForExternalConst(global.context, this.peer)
    }
    /** @deprecated */
    setGenAbcForExternalSources(genAbc: boolean): this {
        global.generatedEs2panda._ProgramSetGenAbcForExternalSources(global.context, this.peer, genAbc)
        return this
    }
    get dump(): string {
        return unpackString(global.generatedEs2panda._ProgramDumpConst(global.context, this.peer))
    }
    /** @deprecated */
    dumpSilent(): this {
        global.generatedEs2panda._ProgramDumpSilentConst(global.context, this.peer)
        return this
    }
    get isDied(): boolean {
        return global.generatedEs2panda._ProgramIsDiedConst(global.context, this.peer)
    }
    /** @deprecated */
    addFileDependencies(file: string, depFile: string): this {
        global.generatedEs2panda._ProgramAddFileDependencies(global.context, this.peer, file, depFile)
        return this
    }
    protected readonly brandProgram: undefined
}
export function isProgram(node: object | undefined): node is Program {
    return node instanceof Program
}
